﻿using Hu.Domain.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hu.Domain.Contexts
{
    //[DbConfigurationType(typeof(ConfigurationConfig))]
    public class HuAdminContext : DbContext
    {
        public HuAdminContext() : base("HuDefault")
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<HuAdminContext, ConfigurationConfig>());
        }


        public DbSet<HuUser> HuUsers { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<HuUser>();//.Property(x => x.Version).IsRowVersion();//基类设置了Timestamp可不用设置此属性
            base.OnModelCreating(modelBuilder);
        }
    }
}
